import Vue from 'vue'
import VueRouter from 'vue-router'

// 引入登录模块
const Login = () =>
    import(/* webpackChunkName: "Login_Home_Welcome" */ '../components/Login.vue')

// 引入主页模式
const Home = () =>
    import(/* webpackChunkName: "Login_Home_Welcome" */ '../components/Home.vue')

// 引入个人信息页面
const Personalinfo = () =>
    import(/* webpackChunkName: "Home_Personalinfo" */ '../components/home_users/Personalinfo.vue')

// 引入密码修改模块
const Modifypassword = () =>
    import(/* webpackChunkName:"Home_User_Modifypassword" */ '../components/home_users/Modifypassword.vue')

// 引入头像编辑模块
const Useravatar = () =>
    import(/* webpackChunkName:"Home_User_Useravatar" */ '../components/home_users/Useravatar.vue')

// 引入用户信息修改区
const Modifyuserinfo = () =>
    import(/* webpackChunkName: "Home_User_Modifyuserinfo" */ '../components/home_users/Modifyuserinfo.vue')

// 引入大数据模块
const Bigdata = () =>
    import(/* webpackChunkName: "Home_Bigdata" */ '../components/home_bigdata/Bigdata.vue')

// 引入所有资源模块
const Allresources = () =>
    import(/* webpackChunkName: "Home_Article_Allresources" */ '../components/home_article/Allresources.vue')

// 引入发布资源模块
const Pubresources = () =>
    import(/* webpackChunkName: "Home_Article_Pubresources" */ '../components/home_article/Pubresources.vue')

// 引入修改资源模块
const Mdyresources = () =>
    import(/* webpackChunkName: "Home_Article_Mdyresources" */ '../components/home_article/Mdyresources.vue')

// 引入资源分类模块
const Resourceclass = () =>
    import(/* webpackChunkName: "Home_Article_Resourceclass" */ '../components/home_classification/Resourceclass.vue')

// 引入评论功能模块
const Commentfun = () =>
    import(/* webpackChunkName: "Home_Comment_Commentfun" */ '../components/home_comment/Commentfun.vue')

// 引入用户管理模块
const Usermanagement = () =>
    import(/* webpackChunkName: "Home_User_Usermanagement" */ '../components/home_users/Usermanagement.vue')

// 引入网站设置模块
const Webset = () =>
    import(/* webpackChunkName:"Home_Setup_Webset" */ '../components/home_setup/Webset.vue')

// 引入网站轮播图列表模块
const Allbgimg = () =>
    import(/* webpackChunkName:"Home_Setup_Allbgimg" */ '../components/home_setup/Allbgimg.vue')

// 引入网站轮播图设置模块
const Addbgimg = () =>
    import(/* webpackChunkName:"Home_Setup_Addbgimg" */ '../components/home_setup/Addbgimg.vue')

Vue.use(VueRouter)

const routes = [
    { path: '/', redirect: '/mylogin' },
    { path: '/mylogin', component: Login },
    {
        path: '/myhome',
        component: Home,
        redirect: '/bigdata',
        children: [
            { path: '/userpi', component: Personalinfo },
            { path: '/modifypwd', component: Modifypassword },
            { path: '/modifyui', component: Modifyuserinfo },
            { path: '/useravatar', component: Useravatar },
            { path: '/bigdata', component: Bigdata },
            { path: '/allresources', component: Allresources },
            { path: '/pubresources', component: Pubresources },
            { path: '/mdyresources', component: Mdyresources },
            { path: '/resourceclass', component: Resourceclass },
            { path: '/commentfun', component: Commentfun },
            { path: '/usermanagement', component: Usermanagement },
            { path: '/webset', component: Webset },
            { path: '/allbgimg', component: Allbgimg },
            { path: '/addbgimg', component: Addbgimg }
        ]
    }
]

const router = new VueRouter({
    routes
})

export default router
